<style>
.placeholder { color:#cdcdcd;}
</style>
<script src="/js/jquery.placeholder.js" type="text/javascript"></script>
<!-- banner start -->
<div id="forgot_banner" >
    <!-- Login Popup Start -->
    <div class="register-box forgot-box" id="forgot-box">
        <div class="register-contbox forgot-contbox" style="height:320px !important">
            <form action="" name="resetpass" id="resetpass" method="post">				
				<h1>Reset Password? <a href="/" id="close_button"></a></h1>
				 <?php if($this->error=='1'){?>
					<div  style="border-bottom:0px;">		           
					<h2 style="color:green;text-align:center; margin-top:20%;" >Your password already reset!</h2>
					<?}else{?>
					 <div class="log-fld" style="border-bottom:0px;">
						<div class="log-bx">					                       
							<div class="clearfix"></div>
							<div class="log-lftbx" style="width:30%;">New Password<span>*</span></div>
							<div class="log-rhtbx" style="width:65%;">
								<input type="password" value="" name="password" id="password" placeholder="Enter your New Password" style="width:90%;margin-bottom:20px; margin-left:7%;">
								
							</div><div class="clearfix"></div>
							<div class="log-lftbx" style="width:35%;">Confirm Password<span>*</span></div>
							<div class="log-rhtbx" style="width:65%;">
								<input type="password" value="" name="confirm_password" id="confirm_password" placeholder="Enter your Confirm password" style="width:89%;">
								
							</div>						
						</div>
						<div class="log-butbg">
						<input type="button" id="resetpassword" name="resetpassword" value="RESET PASSWORD" style="background:#5CB336;border:1px solid #5CB336;padding:5px; border-radius:3px;color:#FFFFFF;font-size:14px; cursor:pointer;font-family: 'robotoregular',sans-serif;" onclick="return resetPassword1();">
						<input type="hidden" id="tokenid" name="tokenid" value="<?echo $_GET['token']?>"/>
						<input type="hidden" name="fgtemail" id="fgtemail" readonly="true" value="<?php echo $this->tokendetail->email_id?>"/><br/><br/>
						<span class="valid-error" id="errorrestpassword"style="width:50%;margin-left:9%;"></span>
						<span class="valid-error" id="errorrestpassword1"style="width:50%;margin-left:9%;"></span>
						<span class="valid-error" id="errorrestpassword2"style="width:50%;margin-left:9%;"></span>
						<span class="valid-error" id="successresetpassword"style="width:50%;margin-left:9%;color:green"></span>
						</div>
					<?}?>					
					<div class="clearfix"></div>
        	        <!--<div style="border-bottom:1px solid #F1F2F6;clear:both;margin:0;padding:0;"></div>           -->     
			    </div>
            </form>
        </div>
    </div>
    <!-- Login Popup End -->    
</div><br/><br/>
<!-- banner end-->

<!-- container start -->
<div id="home-container">
	<div id="hcontainer">
    <ul>
        <!--<a href="#"><li><span class="board"></span>Solved Board <br/>Papers</li></a>-->
        <a href="#"><li><span class="learning"></span>Extramarks<br/>Learning Materials</li></a>
        <a href="#"><li><span class="blog"></span>Extramarks<br/>Blog</li></a>
        <a href="#"><li><span class="school"></span>&nbsp;&nbsp;School<br/>&nbsp;&nbsp;Solutions</li></a>
    </ul>
</div>

</div>
<div class="clearfix"></div>
<script>	
function resetPassword1(){	
	var flag=true;	
	if($("#confirm_password").val()==""){
		$("#errorrestpassword").css('display','none');
		$("#errorrestpassword1").css('display','block');
		$("#errorrestpassword1").html('Please enter confirm password..');
		flag=false;
	}else if($("#confirm_password").val()!=$("#password").val()){
		$("#errorrestpassword").css('display','none');
		$("#errorrestpassword1").css('display','none');
		$("#errorrestpassword2").css('display','block');
		$("#errorrestpassword2").html('Entered confirm password not match new password');
		flag=false;
	}else{
		$("#errorrestpassword1").html('');
		$("#errorrestpassword").html('');
		$("#errorrestpassword2").html('');
	}
	if($("#password").val()==""){
		$("#errorrestpassword1").css('display','none');
		$("#errorrestpassword2").css('display','none');
		$("#errorrestpassword").css('display','block');
		$("#errorrestpassword").html('Please enter new password..');
		flag=false;
	}else{
		$("#errorrestpassword").html('');
	}
	if(flag==false){
		return false;
	}else{
		$.ajax({
			type:	'POST',
			url:   	'/user/update-password',
			data:	$( "#resetpass" ).serialize(),
			success: function(data){					
				if(data.output=='success'){
					$("#errorrestpassword").css('display','none');
					$("#successresetpassword").css('display','block');
					$('#successresetpassword').html('Successfully change your password...');
					 window.location="/";
				}else{
					$("#errorrestpassword").css('display','none');
					$("#successresetpassword").css('display','block');
					$('#successresetpassword').html('Not change your password');
				}
			}
		});
	}
}
</script>